<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        nums = [2, 7, 11, 15], target = 9
        var twoSum = function(nums, target) {
            for (let i=0;i<nums.length;i++){
                for (let j=i+1;j<nums.length;j++){
                    if (nums[j] == target-nums[i]){
                        return [i,j]
                    }
                }
            }
        };
        console.log(twoSum(nums, target));
    </script>
</body>
</html>